nn, dd = 1, 3
import fractions

for d in xrange(4, 1000000 + 1):
    n = 3 * d / 7
    if 3 * d % 7 == 0:
        n -= 1
    g = fractions.gcd(n, d)
    mn, md = n / g, d / g
    if mn * dd > md * nn:
        nn, dd = mn, md

print  nn, dd

